<?php 
  if(!isset($_SESSION['userid'])){
    session_start();
  } 
?>
<nav class="navbar navbar-default navbar-collapse navbar-inverse">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand glyphicon glyphicon-home" style="font-size:40px;font-weight: bolder;color: white;"></a>
      <a class="navbar-brand" href="<?php echo $config['local']; ?>/index.php" style="font-size:35px;font-weight: bolder;color: white;">博客首页</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li id="nav_article">
        <a href="<?php echo $config['local'] ?>/admin/article/index.php">文章 <span class="sr-only">(current)</span>
        </a>
        </li>
        <li id="nav_category" ><a href="<?php echo $config['local'] ?>/admin/category/index.php">分类</a></li>
       <li><a href="#" data-toggle="dropdown">系统设置 <span class="caret"></span></a>
              <ul id="menu3" class="dropdown-menu" aria-labelledby="drop6">
                <li><a href="<?php echo $config['local']?>/admin/system/setting.php">基本设置</a></li>
                <li><a href="<?php echo $config['local']?>/admin/system/banner.php">幻灯片</a></li>
                <li><a href="<?php echo $config['local']?>/admin/system/adminlist.php">管理员设置</a></li>
              </ul>
            </li>
      </ul>
      <form class="navbar-form navbar-left"  action="<?php echo $config['local'] ?>/admin/article/index.php" method="get">
        <div class="form-group">
          <input type="text" class="form-control"  name="seek" placeholder="搜索博客文章……">
        </div>
        <button type="submit" class="btn btn-default"  name="find" value="1">搜&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;索</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        
        <!-- <li><a href="<?php echo $config['local'] ?>/admin/login.php">登录</a></li> -->
        <?php if (isset($_SESSION['userid'])) { ?>
            <li><a>欢迎&nbsp;<?php echo $_SESSION['username'] ?>&nbsp;的到来！</a></li>
            <!-- <li><a href="<?php echo $config['local'] ?>/admin/loginout.php">退出登录</a></li> -->
        <?php } ?>
        
        <!-- <li><a href="../login_register/register.php">注册</a></li> -->
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">其他操作 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li role="separator" class="divider"></li>
            <li><a href="<?php echo $config['local'] ?>/admin/article/messages.php">留言管理</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="<?php echo $config['local'] ?>/admin/trash.php">垃圾处理机制</a></li>
            <li role="separator" class="divider"></li>
            <?php if (isset($_SESSION['userid'])) { ?>
              <li><a href="<?php echo $config['local'] ?>/admin/loginout.php">退出登录</a></li>
            <?php } ?>
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
<script type="text/javascript">
	$('#nav_category').hover(function(){
		$('#nav_category').css('background','gray');
	},function(){
		$('#nav_category').css('background','none');
	});
	$('#nav_article').hover(function(){
		$('#nav_article').css('background','gray');
	},function(){
		$('#nav_article').css('background','none');
	});
</script>
<?php
  